home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Extras / IFF / IFF_Forms / ILBM.DRNG.doc < prev    next >
Encoding:
Text File  |  1993-03-01  |  2.9 KB  |  88 lines

  1. DPaint IV enhanced color cycle chunk (EA)
  2.  
  3. DRNG Chunk for FORM ILBM
  4. ========================
  5.  
  6. Submitted by Lee Taran
  7.  
  8. Purpose:
  9.  
  10. Enhanced Color Cycling Capabilities
  11. -------------------------------------
  12.    * DPaintIV supports a new color cycling model which does NOT
  13.      require that color cycles contain a contiguous range of color
  14.      registers.
  15.  
  16.      For example:
  17.        If your range looks like:  [1][3][8][2]
  18.        then at each cycle tick
  19.           temp = [2], 
  20.           [2] = [8],
  21.           [8] = [3],
  22.           [3] = [1], 
  23.           [1] = temp
  24.  
  25.    * You can now cycle a single register thru a series of rgb values.
  26.      For example:
  27.         If your range looks like: [1] [orange] [blue] [purple]
  28.         then at each cycle tick color register 1 will take on the
  29.         next color in the cycle.
  30.          
  31.         ie:  t=0:  [1] = curpal[1]
  32.              t=1:  [1] = purple
  33.              t=2:  [1] = blue
  34.              t=3:  [1] = orange
  35.              t=4:  goto t=0
  36.  
  37.    * You can combine rgb cycling with traditional color cycling.
  38.      For example:
  39.          Your range can look like:
  40.              [1] [orange] [blue] [2] [green] [yellow]
  41.  
  42.          t=0: [1] = curpal[1], [2] = curpal[2]
  43.          t=1: [1] = yellow,    [2] = blue
  44.          t=2: [1] = green,     [2] = orange
  45.          t=3: [1] = curpal[2], [2] = curpal[1]
  46.          t=4: [1] = blue,      [2] = yellow
  47.          t=5: [1] = orange,    [2] = green
  48.          t=6: goto t=0
  49.  
  50. Note:
  51.    * DPaint will save out an old style range CRNG if the range fits
  52.      the CRNG model otherwise it will save out a DRNG chunk. 
  53.    * no thought has been given (yet) to interlocking cycles
  54.  
  55.  
  56.  
  57. /* --------------------------------------------------------------------- 
  58.  
  59.  IFF Information:  DPaintIV DRNG chunk
  60.  
  61.           DRNG ::= "DRNG" # { DRange DColor* DIndex* }
  62.                                                                       
  63.  a <cell> is where the color or register appears within the range     
  64.  
  65.  The RNG_ACTIVE flags is set when the range is cyclable. A range 
  66.  should only have the RNG_ACTIVE if it:
  67.       1> contains at least one color register
  68.       2> has a defined rate 
  69.       3> has more than one color and/or color register
  70.  If the above conditions are met then RNG_ACTIVE is a user/program 
  71.  preference.  If the bit is NOT set the program should NOT cycle the
  72.  range.
  73.  
  74.  The RNG_DP_RESERVED flags should always be 0!!!
  75.  --------------------------------------------------------------------- */
  76. typedef struct {
  77.    UBYTE min;           /* min cell value */
  78.    UBYTE max;           /* max cell value */
  79.    SHORT rate;          /* color cycling rate, 16384 = 60 steps/second */
  80.    SHORT flags;         /* 1=RNG_ACTIVE,4=RNG_DP_RESERVED */
  81.    UBYTE ntrue;         /* number of DColor structs to follow */
  82.    UBYTE nregs;         /* number of DIndex structs to follow */
  83.    } DRange;           
  84.  
  85. typedef struct { UBYTE cell; UBYTE r,g,b; } DColor; /* true color cell */
  86. typedef struct { UBYTE cell; UBYTE index; } DIndex; /* color register cell */
  87.  
  88.